1. Field of the Invention
The present invention relates to a method and device for mapping input grayscales into output luminance, and more particularly, to a method and device for mapping input grayscales into output luminance by computing a quadratic equation to precisely approximate any segments of ideal gamma curve.
2. Description of the Prior Art
In n-bit color depth display devices, each pixel of the display device has 2^n grayscales, each of which corresponds to a specific voltage level. In other words, various degrees of bright/dark visual performances are achieved by driving each pixel with 2^n distinct voltage levels.
Please refer to FIG. 1, which illustrates an ideal gamma curve for mapping input grayscales into distinct voltage levels, respectively. Take an 8-bit color depth display device for example, there are grayscales 1 to 254 corresponding to distinct 254 voltage levels for the ideal gamma curve, wherein grayscales 0 and 255 are respectively pure dark and pure white.
Traditionally, there are two methods for mapping the input grayscales into distinct voltage levels to perform bright/dark visual performances based on analog or digital operating environment.
For analog operating environment, a gamma voltage generator is composed of a plurality of series of resistors for generating distinct voltage levels. Under control of a logic device, the gamma voltage generator generates the specific gamma voltage corresponding to the input grayscale. However, resistances of the resistors are fixed once the gamma voltage generator is produced, which is customized only for one display model.
For digital operating environment, a pair of one grayscale and the corresponding voltage level forms a point or coordinate of the gamma curve shown in FIG. 1. Information of 254 points of the gamma curve for the 8-bit color depth display device is stored in a lookup table device of the display device, such that the display device is able to generate distinct voltage levels according to contents of the lookup table device. Contents of the lookup table device, e.g. one time programmable (OTP) memory, can be modified and customized for various display models, which is beneficial for mass production for various display models.
However, in practice, there is a limited number N of pinch points, instead of all the 254 points, stored in the lookup table device to save a hardware area of the lookup table device so as to save a production cost of the display device. The gamma voltages corresponding to the points other than the limited number N of pinch points are generated by computing a linear transformation equation for approximating the ideal gamma curve.
For example, any two of nearby pinch points determine a linear transformation equation, and a gamma voltage corresponding to an input grayscale between the nearby pinch points can be generated by performing a linear interpolation on the linear transformation equation. However, the ideal gamma curve shown in FIG. 1 is a nonlinear curve, and thus there is an approximation error when using the linear transformation equation to approximate the nonlinear gamma curve, which may cause unsmooth grayscale representation on the display device to be sensed by human vision.
In order to avoid unsmooth grayscale representation from the display device and improve a display quality of the display device, as many as pinch points are required, a greater hardware area of the lookup table device and a higher production cost of the display device are also required. In other words, there is a dilemma between the display quality and the production cost, i.e. smooth grayscale representation and the hardware area of the lookup table unit, based on a traditional mapping scheme for mapping the input grayscales into corresponding voltage levels, i.e. the linear interpolation on the linear transformation equation for approximating the nonlinear gamma curve.
Therefore, there is a need to improve the prior art.